//
//  GQDIYRefreshHeader.m
//  TingMusic
//
//  Created by sunny on 16/4/23.
//  Copyright © 2016年 sunny. All rights reserved.
//

#import "GQDIYRefreshHeader.h"

@implementation GQDIYRefreshHeader
+ (instancetype)gq_headerWithRefreshingBlock:(GQRefreshingBlock)refreshingBlock
{
//    设置动画图片
    NSMutableArray *pullImages = [NSMutableArray array];
    for (int i = 1; i <= 60; i++) {
        [pullImages addObject:[UIImage imageNamed:[NSString stringWithFormat:@"dropdown_anim__000%d",i]]];
    }
    
    NSArray *refreshImages = @[
                               [UIImage imageNamed:@"dropdown_loading_01"],
                               [UIImage imageNamed:@"dropdown_loading_02"],
                               [UIImage imageNamed:@"dropdown_loading_03"]
                               ];
    GQDIYRefreshHeader *header = [GQDIYRefreshHeader headerWithRefreshingBlock:refreshingBlock];
    [header setImages:pullImages forState:MJRefreshStateIdle];
    [header setImages:refreshImages forState:MJRefreshStatePulling];
    [header setImages:refreshImages forState:MJRefreshStateRefreshing];
    
   return header;
}
@end
